package han.gui;

import han.project.speakingcookbook.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class ListViewMeal extends Activity{
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.listviewmeal_activity);
		String[] values = new String[] { "Spagehti", "Pfannekuchen", "more", "and", "more"};
	
		RecipeListAdapter adapter = new RecipeListAdapter(this, values);
		ListView lv = (ListView)findViewById(R.id.listViewMeal);
		
		lv.setAdapter(adapter);
		
		lv.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view, int posi,
					long id) {
				Intent i = new Intent(ListViewMeal.this, CookingView.class);
//				i.putExtra("Recipe", lv.getAdapter().getItem(posi).toString());
				startActivity(i);
				
			}
		});
	}
	

}
